<template>
  <div class="item" @click="gotoDetails(data.id)">
    <div class="hot">
      <img
        v-show="data.isHotSale == 1"
        src="../assets/img/section_hot.png"
        alt=""
      />
      <img
        v-show="data.isLatest == 1"
        src="../assets/img/section_new.png"
        alt=""
      />
    </div>
    <div class="item-img">
      <img :src="'http://sc.wolfcode.cn' + data.coverImg" alt="" />
    </div>
    <div class="item-content">
      <p>{{ data.name }}</p>
      <div class="Price">
        {{ data.coin }}
        <img src="../assets/img/monad.png" alt="" />
      </div>
      <div class="exchange">立即兑换</div>
    </div>
  </div>
</template>

<script>
export default {
  name: "JifenThreeFineItem",
  data() {
    return {};
  },
  props: {
    data: {
      type: Object,
      default: {},
    },
  },
  methods: {
    gotoDetails(id) {
      this.$router.push(`/details?id=${id}`);
    },
  },
};
</script>

<style lang="less" scoped>
.item {
  width: 285px;
  height: 547px;
  margin-bottom: 20px;
  transition: 0.5s;
  position: relative;
  float: left;
  margin-right: 20px;
  .hot {
    width: 58px;
    height: 58px;
    position: absolute;
  }
  .item-img {
    width: 285px;
    height: 331px;
    img {
      width: 285px;
      height: 331px;
    }
  }
  .item-content {
    width: 285px;
    height: 216px;
    background: #ffffff;
    border-top: 1px solid transparent;
    box-sizing: border-box;
    p {
      text-align: center;
      height: 18px;
      font-size: 18px;
      font-family: SourceHanSansSC;
      font-weight: 300;
      color: #333333;
      line-height: 23px;
      margin: 44px 0 20px;
    }
    .Price {
      text-align: center;
      height: 18px;
      font-size: 18px;
      font-family: SourceHanSansSC;
      font-weight: bold;
      color: #fd604d;
      line-height: 23px;
      margin: auto;
      padding: 16px 0 24px;
      img {
        width: 20px;
        height: 20px;
        vertical-align: middle;
      }
    }
    .exchange {
      width: 100px;
      height: 36px;
      border: 1px solid #0a328e;
      text-align: center;
      line-height: 36px;
      margin: auto;
      color: #0a328e;
    }
  }
  // 鼠标移上
  &:hover {
    // 向上位移
    transform: translateY(-15px);
    .exchange {
      background: #0a328e;
      color: #ffffff;
    }
  }
}
</style>